<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <input type="text" v-model="msg">
        {{ msg.split('').reverse().join("") }}
        <hr>
        {{ reverseMsg }}
        {{ reverseMsg }}
        {{ reverseMsg }}
        <hr>
        {{ reverseMsg2() }}
        {{ reverseMsg2() }}
        {{ reverseMsg2() }}
    </div>
    <script src="./vue.js"></script>
    <script>
        let vm = new Vue({
            el:"#app",
            data:{
              msg:"hello"
            },
            methods:{
                reverseMsg2(){
                    console.log('我是methods中的')
                    return this.msg.split('').reverse().join("")
                }
            },
            computed:{
                reverseMsg(){
                    console.log('我是计算属性')
                    return this.msg.split('').reverse().join("")
                }
            }
        })
        console.log(vm);
    </script>
</body>
</html>